<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="insn.css"/><meta name="generator" content="iform.xsl"/><title>PACIB, PACIB1716, PACIBSP, PACIBZ, PACIZB -- A64</title></head><body><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="sveindex.html">SVE Instructions</a></div></td><td><div class="topbar"><a href="mortlachindex.html">SME Instructions</a></div></td><td><div class="topbar"><a href="encodingindex.html">Index by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><hr/><h2 class="instruction-section">PACIB, PACIB1716, PACIBSP, PACIBZ, PACIZB</h2>
      <p class="aml">Pointer Authentication Code for Instruction address, using key B. This instruction computes and inserts a pointer authentication code for an instruction address, using a modifier and key B.</p>
      <p class="aml">The address is:</p>
      <ul>
        <li>In the general-purpose register that is specified by &lt;Xd&gt; for <span class="asm-code">PACIB</span> and <span class="asm-code">PACIZB</span>.</li>
        <li>In X17, for <span class="asm-code">PACIB1716</span>.</li>
        <li>In X30, for <span class="asm-code">PACIBSP</span> and <span class="asm-code">PACIBZ</span>.</li>
      </ul>
      <p class="aml">The modifier is:</p>
      <ul>
        <li>In the general-purpose register or stack pointer that is specified by &lt;Xn|SP&gt; for <span class="asm-code">PACIB</span>.</li>
        <li>The value zero, for <span class="asm-code">PACIZB</span> and <span class="asm-code">PACIBZ</span>.</li>
        <li>In X16, for <span class="asm-code">PACIB1716</span>.</li>
        <li>In SP, for <span class="asm-code">PACIBSP</span>.</li>
      </ul>
    
    <p class="desc">
      It has encodings from 2 classes:
      <a href="#iclass_general">Integer</a>
       and 
      <a href="#iclass_system">System</a>
    </p>
    <h3 class="classheading"><a id="iclass_general"/>Integer<span style="font-size:smaller;"><br/>(FEAT_PAuth)
          </span></h3><p class="desc"/><div class="regdiagram-32"><table class="regdiagram"><thead><tr><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr></thead><tbody><tr class="firstrow"><td class="lr">1</td><td class="lr">1</td><td class="lr">0</td><td class="l">1</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td><td class="r">0</td><td class="l">0</td><td>0</td><td>0</td><td>0</td><td class="r">1</td><td class="lr">0</td><td class="lr">0</td><td class="lr">Z</td><td class="l">0</td><td>0</td><td class="r">1</td><td colspan="5" class="lr">Rn</td><td colspan="5" class="lr">Rd</td></tr></tbody></table></div><div class="encoding"><h4 class="encoding">PACIB<span class="bitdiff"> (Z == 0)</span></h4><a id="PACIB_64P_dp_1src"/><p class="asm-code">PACIB  <a href="#sa_xd" title="64-bit general-purpose destination register (field &quot;Rd&quot;)">&lt;Xd&gt;</a>, <a href="#sa_xn_sp" title="64-bit general-purpose source register or SP (field &quot;Rn&quot;)">&lt;Xn|SP&gt;</a></p></div><div class="encoding"><h4 class="encoding">PACIZB<span class="bitdiff"> (Z == 1 &amp;&amp; Rn == 11111)</span></h4><a id="PACIZB_64Z_dp_1src"/><p class="asm-code">PACIZB  <a href="#sa_xd" title="64-bit general-purpose destination register (field &quot;Rd&quot;)">&lt;Xd&gt;</a></p></div><p class="pseudocode">boolean source_is_sp = FALSE;
integer d = <a href="shared_pseudocode.html#impl-shared.UInt.1" title="function: integer UInt(bits(N) x)">UInt</a>(Rd);
integer n = <a href="shared_pseudocode.html#impl-shared.UInt.1" title="function: integer UInt(bits(N) x)">UInt</a>(Rn);

if !<a href="shared_pseudocode.html#impl-aarch64.HavePACExt.0" title="function: boolean HavePACExt()">HavePACExt</a>() then
    UNDEFINED;

if Z == '0' then // PACIB
    if n == 31 then source_is_sp = TRUE;
else // PACIZB
    if n != 31 then UNDEFINED;</p>
    <h3 class="classheading"><a id="iclass_system"/>System<span style="font-size:smaller;"><br/>(FEAT_PAuth)
          </span></h3><p class="desc"/><div class="regdiagram-32"><table class="regdiagram"><thead><tr><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr></thead><tbody><tr class="firstrow"><td class="l">1</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td class="r">0</td><td class="lr">0</td><td class="l">0</td><td class="r">0</td><td class="l">0</td><td>1</td><td class="r">1</td><td class="l">0</td><td>0</td><td>1</td><td class="r">0</td><td class="l">0</td><td>0</td><td>x</td><td class="r">1</td><td class="l">0</td><td>1</td><td class="r">x</td><td class="l">1</td><td>1</td><td>1</td><td>1</td><td class="r">1</td></tr><tr class="secondrow"><td colspan="10"/><td/><td colspan="2"/><td colspan="3"/><td colspan="4"/><td colspan="4" class="droppedname">CRm</td><td colspan="3" class="droppedname">op2</td><td colspan="5"/></tr></tbody></table></div><div class="encoding"><h4 class="encoding">PACIB1716<span class="bitdiff"> (CRm == 0001 &amp;&amp; op2 == 010)</span></h4><a id="PACIB1716_HI_hints"/><p class="asm-code">PACIB1716</p></div><div class="encoding"><h4 class="encoding">PACIBSP<span class="bitdiff"> (CRm == 0011 &amp;&amp; op2 == 011)</span></h4><a id="PACIBSP_HI_hints"/><p class="asm-code">PACIBSP</p></div><div class="encoding"><h4 class="encoding">PACIBZ<span class="bitdiff"> (CRm == 0011 &amp;&amp; op2 == 010)</span></h4><a id="PACIBZ_HI_hints"/><p class="asm-code">PACIBZ</p></div><p class="pseudocode">integer d;
integer n;
boolean source_is_sp = FALSE;

case CRm:op2 of
    when '0011 010'    // PACIBZ
        d = 30;
        n = 31;
    when '0011 011'    // PACIBSP
        d = 30;
        source_is_sp = TRUE;
        if <a href="shared_pseudocode.html#impl-shared.HaveBTIExt.0" title="function: boolean HaveBTIExt()">HaveBTIExt</a>() then
            // Check for branch target compatibility between PSTATE.BTYPE
            // and implicit branch target of PACIBSP instruction.
            <a href="shared_pseudocode.html#impl-aarch64.SetBTypeCompatible.1" title="function: SetBTypeCompatible(boolean x)">SetBTypeCompatible</a>(<a href="shared_pseudocode.html#impl-aarch64.BTypeCompatible_PACIXSP.0" title="function: boolean BTypeCompatible_PACIXSP()">BTypeCompatible_PACIXSP</a>());
    when '0001 010'    // PACIB1716
        d = 17;
        n = 16;
    when '0001 000' SEE "PACIA";
    when '0001 100' SEE "AUTIA";
    when '0001 110' SEE "AUTIB";
    when '0011 00x' SEE "PACIA";
    when '0011 10x' SEE "AUTIA";
    when '0011 11x' SEE "AUTIB";
    when '0000 111' SEE "XPACLRI";
    otherwise SEE "HINT";</p>
  <div class="encoding-notes"/><h3 class="explanations">Assembler Symbols</h3><div class="explanations"><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;Xd&gt;</td><td><a id="sa_xd"/>
        
          <p class="aml">Is the 64-bit name of the general-purpose destination register, encoded in the "Rd" field.</p>
        
      </td></tr></table><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;Xn|SP&gt;</td><td><a id="sa_xn_sp"/>
        
          <p class="aml">Is the 64-bit name of the general-purpose source register or stack pointer, encoded in the "Rn" field.</p>
        
      </td></tr></table></div><div class="syntax-notes"/>
    <div class="ps"><a id="execute"/><h3 class="pseudocode">Operation</h3>
      <p class="pseudocode">if <a href="shared_pseudocode.html#impl-aarch64.HavePACExt.0" title="function: boolean HavePACExt()">HavePACExt</a>() then
    if source_is_sp then
        <a href="shared_pseudocode.html#impl-aarch64.X.write.2" title="accessor: X[integer n, integer width] = bits(width) value">X</a>[d, 64] = <a href="shared_pseudocode.html#impl-aarch64.AddPACIB.2" title="function: bits(64) AddPACIB(bits(64) x, bits(64) y)">AddPACIB</a>(<a href="shared_pseudocode.html#impl-aarch64.X.read.2" title="accessor: bits(width) X[integer n, integer width]">X</a>[d, 64], <a href="shared_pseudocode.html#impl-aarch64.SP.read.0" title="accessor: bits(64) SP[]">SP</a>[]);
    else
        <a href="shared_pseudocode.html#impl-aarch64.X.write.2" title="accessor: X[integer n, integer width] = bits(width) value">X</a>[d, 64] = <a href="shared_pseudocode.html#impl-aarch64.AddPACIB.2" title="function: bits(64) AddPACIB(bits(64) x, bits(64) y)">AddPACIB</a>(<a href="shared_pseudocode.html#impl-aarch64.X.read.2" title="accessor: bits(width) X[integer n, integer width]">X</a>[d, 64], <a href="shared_pseudocode.html#impl-aarch64.X.read.2" title="accessor: bits(width) X[integer n, integer width]">X</a>[n, 64]);</p>
    </div>
  <hr/><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="sveindex.html">SVE Instructions</a></div></td><td><div class="topbar"><a href="mortlachindex.html">SME Instructions</a></div></td><td><div class="topbar"><a href="encodingindex.html">Index by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><p class="versions">
      Internal version only: isa v33.62, AdvSIMD v29.12, pseudocode v2023-03_rel, sve v2023-03_rc3b
      ; Build timestamp: 2023-03-31T11:36
    </p><p class="copyconf">
      Copyright © 2010-2023 Arm Limited or its affiliates. All rights reserved.
      This document is Non-Confidential.
    </p></body></html>
